﻿//  -------------------- iSharePoint -------------------- //
// 
//  Company:	IT Complex, LLC
//  Project:	Smart.Common
//  File name:	IQueryExecutor.cs
//  Developer:	Solomatov Igor
//  Created:	15.04.2012
// 
//  -------------------- iSharePoint -------------------- //

namespace Smart.Common.Entities
{
	/// <summary>
	/// Query executor
	/// </summary>
	public interface IQueryExecutor<TEntityType, TQueryExecutor>
		where TEntityType : Entity
		where TQueryExecutor : class
	{
		/// <summary>
		/// Query builder
		/// </summary>
		IQueryBuilder<TQueryExecutor> Query { get; set; }

		/// <summary>
		/// Execute query and return list of entities
		/// </summary>
		IEntityList<TEntityType> Execute();

		/// <summary>
		/// Execute query and return list of entities
		/// </summary>
		IEntityList<TEntityType> Execute(int rowLimit);

		/// <summary>
		/// Execute query and return list of entities
		/// </summary>
		IEntityList<TEntityType> Execute(IQueryBuilder builder, int rowLimit);

		/// <summary>
		/// Execute query and return list of entities
		/// </summary>
		IEntityList<TEntityType> Execute(string query, int rowLimit);

		/// <summary>
		/// Execute query and return only one first entity
		/// </summary>
		TEntityType ExecuteOne();
	}
}